<html>
<head><meta charset="utf-8"><title>resolving methods · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html">resolving methods</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="245488463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245488463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245488463">(Jul 09 2021 at 19:44)</a>:</h4>
<p>So I was talking to <span class="user-mention" data-user-id="325709">@Jade</span> about extending chalk to be able to identify the definition of a particular method, so that rust-analyzer can do a better job with jump-to-definition</p>



<a name="245488465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245488465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245488465">(Jul 09 2021 at 19:44)</a>:</h4>
<p>This is of course something rustc is going to need</p>



<a name="245488507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245488507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245488507">(Jul 09 2021 at 19:44)</a>:</h4>
<p>The basic idea is to model it very similarly to assoc type equality, though we really <em>only</em> need the <code>Normalize</code> predicate, I think, not <code>ProjectionEq</code> and all that jazz</p>



<a name="245488541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245488541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245488541">(Jul 09 2021 at 19:45)</a>:</h4>
<p>I'm going to open a chalk issue and dump some of the notes from the paper doc we were using</p>



<a name="245488729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245488729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245488729">(Jul 09 2021 at 19:46)</a>:</h4>
<p>So, the idea is being able to answer what impl matches?</p>



<a name="245488762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245488762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245488762">(Jul 09 2021 at 19:46)</a>:</h4>
<p>Yep.</p>



<a name="245488931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245488931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245488931">(Jul 09 2021 at 19:48)</a>:</h4>
<p>One question I forgot to ask is, how does this interact with specialization? The answer of "what impl is it (or is it in the trait itself)" would change per-function then.</p>



<a name="245489088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245489088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245489088">(Jul 09 2021 at 19:49)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/issues/716">https://github.com/rust-lang/chalk/issues/716</a></p>



<a name="245489143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245489143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245489143">(Jul 09 2021 at 19:50)</a>:</h4>
<p>I'll fill in the impl steps in a sec, have to go check on the flooding basement <span aria-label="rainy" class="emoji emoji-1f327" role="img" title="rainy">:rainy:</span></p>



<a name="245489173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245489173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245489173">(Jul 09 2021 at 19:50)</a>:</h4>
<p>o.o good luck</p>



<a name="245489913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245489913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245489913">(Jul 09 2021 at 19:56)</a>:</h4>
<p>the rain has slowed down now</p>



<a name="245489938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245489938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245489938">(Jul 09 2021 at 19:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="325709">Jade</span> <a href="#narrow/stream/144729-wg-traits/topic/resolving.20methods/near/245488931">said</a>:</p>
<blockquote>
<p>One question I forgot to ask is, how does this interact with specialization? The answer of "what impl is it (or is it in the trait itself)" would change per-function then.</p>
</blockquote>
<p>answer: same way it does for assoc types, which admittedly we're still experimenting with a bit;</p>



<a name="245489965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245489965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245489965">(Jul 09 2021 at 19:57)</a>:</h4>
<p>the naive thing will land you with ambiguity</p>



<a name="245489973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245489973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245489973">(Jul 09 2021 at 19:57)</a>:</h4>
<p>because you now have overlapping impls, as we discussed</p>



<a name="245490987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245490987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245490987">(Jul 09 2021 at 20:05)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/issues/716#issuecomment-877427095">implementation steps</a></p>



<a name="245491039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245491039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245491039">(Jul 09 2021 at 20:05)</a>:</h4>
<p><span class="user-mention" data-user-id="325709">@Jade</span> are you <code>lf-</code> on github?</p>



<a name="245491054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245491054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245491054">(Jul 09 2021 at 20:05)</a>:</h4>
<p>Yes.</p>



<a name="245883716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245883716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245883716">(Jul 13 2021 at 20:36)</a>:</h4>
<p>This is going, OK, mostly. It's taken a lot of time to learn stuff, and I'm just through getting the types right and the parser/lowering almost there.</p>



<a name="245947118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245947118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245947118">(Jul 14 2021 at 11:27)</a>:</h4>
<p>The front end of this part of the chalk "compiler", is done, but now I got to the part with actually generating program clauses and I'm lost. I think I need an example of a NormalizeFn rule with a sample trait. I'm particularly confused about the rules I need to add as conditions to the expression</p>



<a name="245955637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/245955637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#245955637">(Jul 14 2021 at 12:59)</a>:</h4>
<p>I think it should pretty much match the <code>Normalize</code> rule: <a href="https://github.com/rust-lang/chalk/blob/9456600c1649ef6aad9a7a2e38312185047ec509/chalk-solve/src/clauses/program_clauses.rs#L53-L77">https://github.com/rust-lang/chalk/blob/9456600c1649ef6aad9a7a2e38312185047ec509/chalk-solve/src/clauses/program_clauses.rs#L53-L77</a></p>



<a name="246105817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/246105817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#246105817">(Jul 15 2021 at 14:54)</a>:</h4>
<p><span class="user-mention" data-user-id="325709">@Jade</span> btw, I've created an "office hours" setup: <a href="https://calendly.com/nikomatsakis/office-hours">https://calendly.com/nikomatsakis/office-hours</a></p>



<a name="246105832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/246105832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#246105832">(Jul 15 2021 at 14:54)</a>:</h4>
<p>you can use that to book time with me</p>



<a name="246105846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/246105846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#246105846">(Jul 15 2021 at 14:54)</a>:</h4>
<p>I'll probably expand to more times, I started small</p>



<a name="246358918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/resolving%20methods/near/246358918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/resolving.20methods.html#246358918">(Jul 18 2021 at 04:20)</a>:</h4>
<p>Alright, booked one next week.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>